package org.dromara.Nyt7StatisticsInsureSubRegion.controller;

import java.util.List;

import lombok.RequiredArgsConstructor;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.constraints.*;
import cn.dev33.satoken.annotation.SaCheckPermission;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import org.dromara.common.idempotent.annotation.RepeatSubmit;
import org.dromara.common.log.annotation.Log;
import org.dromara.common.web.core.BaseController;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.core.domain.R;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.log.enums.BusinessType;
import org.dromara.common.excel.utils.ExcelUtil;
import org.dromara.Nyt7StatisticsInsureSubRegion.domain.vo.Nyt7StatisticsInsureSubRegionVo;
import org.dromara.Nyt7StatisticsInsureSubRegion.domain.bo.Nyt7StatisticsInsureSubRegionBo;
import org.dromara.Nyt7StatisticsInsureSubRegion.service.INyt7StatisticsInsureSubRegionService;
import org.dromara.common.mybatis.core.page.TableDataInfo;

/**
 * 统计分析_投保统计_数量统计_按地区的数量统计
 *
 * @author yt
 * @date 2025-01-06
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/Nyt7StatisticsInsureSubRegion/Nyt7StatisticsInsureSubRegion")
public class Nyt7StatisticsInsureSubRegionController extends BaseController {

    private final INyt7StatisticsInsureSubRegionService nyt7StatisticsInsureSubRegionService;

    /**
     * 查询统计分析_投保统计_数量统计_按地区的数量统计列表
     */
    @SaCheckPermission("Nyt7StatisticsInsureSubRegion:Nyt7StatisticsInsureSubRegion:list")
    @GetMapping("/list")
    public TableDataInfo<Nyt7StatisticsInsureSubRegionVo> list(Nyt7StatisticsInsureSubRegionBo bo, PageQuery pageQuery) {
        return nyt7StatisticsInsureSubRegionService.queryPageList(bo, pageQuery);
    }

    /**
     * 导出统计分析_投保统计_数量统计_按地区的数量统计列表
     */
    @SaCheckPermission("Nyt7StatisticsInsureSubRegion:Nyt7StatisticsInsureSubRegion:export")
    @Log(title = "统计分析_投保统计_政策性补贴统计_按地区统计", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(Nyt7StatisticsInsureSubRegionBo bo, HttpServletResponse response) {
        List<Nyt7StatisticsInsureSubRegionVo> list = nyt7StatisticsInsureSubRegionService.queryList(bo);
        ExcelUtil.exportExcel(list, "统计分析_投保统计_政策性补贴统计_按地区统计", Nyt7StatisticsInsureSubRegionVo.class, response);
    }

}
